package com.example.service.impl;

import com.example.service.DeviceService;
import com.example.domain.Device;
import com.example.mapper.DeviceMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class DeviceServiceImpl implements DeviceService {

    @Autowired
    private DeviceMapper deviceMapper;

    @Override
    public List<Device> getAll() {
        return deviceMapper.getAll();
    }

    @Override
    public Device getById(Integer deviceId) {
        return deviceMapper.getById(deviceId);
    }

    @Override
    public boolean add(Device device) {
        return deviceMapper.add(device);
    }

    @Override
    public boolean update(Device device) {
        return deviceMapper.update(device);
    }

    @Override
    public boolean delete(Integer deviceId) {
        return deviceMapper.delete(deviceId);
    }
}